﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:designer="clr-namespace:Glass.Design.Designer" xmlns:design="clr-namespace:Glass.Design">
    <Style TargetType="{x:Type designer:DesignerItem}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type designer:DesignerItem}">
                    <Border x:Name="Border" 
                            BorderThickness="{TemplateBinding BorderThickness}" 
                            BorderBrush="{TemplateBinding BorderBrush}" 
                            Background="{TemplateBinding Background}">
                    	<VisualStateManager.VisualStateGroups>
                    		<VisualStateGroup x:Name="ValidationStates"/>
                    		<VisualStateGroup x:Name="CommonStates">
                    			<VisualStateGroup.Transitions>
                    				<VisualTransition GeneratedDuration="0:0:0.2"/>
                    			</VisualStateGroup.Transitions>
                    			<VisualState x:Name="MouseOver">
                    				<Storyboard>
                    					<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="SelectionBorder">
                    						<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                    					</DoubleAnimationUsingKeyFrames>
                    				</Storyboard>
                    			</VisualState>
                    			<VisualState x:Name="Selected">
                    				<Storyboard>
                    					<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="SelectionBorder">
                    						<EasingDoubleKeyFrame KeyTime="0" Value="0.34"/>
                    					</DoubleAnimationUsingKeyFrames>
                    				</Storyboard>
                    			</VisualState>
                    			<VisualState x:Name="Normal"/>
                    		</VisualStateGroup>
                    	</VisualStateManager.VisualStateGroups>
                        <Grid>
                            <ContentPresenter />
                            <design:DragControl x:Name="PART_DragControl" Cursor="SizeAll" />
                            <Border x:Name="SelectionBorder"  BorderBrush="{x:Static SystemColors.HighlightBrush}" Opacity="0" BorderThickness="2" />
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type designer:Designer}">
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <Canvas IsItemsHost="True" />
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type designer:Designer}">
                    <Border
                        Background="{TemplateBinding Background}">
                        <ItemsPresenter />
                    </Border>

                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>